<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddIndexInSeveralTable extends AbstractMigration
{
    public function up()
    {
        $this->table('review_request_node')
            ->addIndex(['plan_reviewer'], ['type' => 'normal', 'name' => 'idx_review_request_node_plan_reviewer'])
            ->save();
        $this->table('entity_relationships')
            ->addIndex(['entity_id'], ['type' => 'normal', 'name' => 'idx_entity_relationships_entity_id'])
            ->save();
    }

    public function down()
    {
        $this->table('review_request_node')->removeIndexByName('idx_review_request_node_plan_reviewer')->save();
        $this->table('entity_relationships')->removeIndexByName('idx_entity_relationships_entity_id')->save();
    }
}
